﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>从表属性</title>
     <script language="JavaScript" src="../../Comm/JScript.js" type="text/javascript" ></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
    <link href="../../Comm/Style/Table0.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>

    <!-- 导入这个通用的js文件 -->
    <script src="../../Scripts/config.js" type="text/javascript"></script>
    <script src="../../Comm/Gener.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript" >
      
        //页面启动函数.
        $(function () {

            $("#Msg").html("<img src=../../Img/loading.gif />&nbsp;正在加载,请稍后......");

            //初始化groupID.
            var fk_mapData = GetQueryString("FK_MapData");
            var fk_mapDtl = GetQueryString("FK_MapDtl");

            //初始化 GroupID.
            $.ajax({
                type: 'post',
                async: true,
                url: Handler + "?DoType=DtlInit&FK_MapData=" + fk_mapData + "&FK_MapDtl=" + fk_mapDtl + "&m=" + Math.random(),
                dataType: 'html',
                success: function (data) {


                    data = JSON.parse(data);
                    if (data instanceof Array) { //判断是否是数组 如果是数组就取第一个对象 杨玉慧
                        data = data[0];
                    }
                    //取出来两个表.
                    var main = data["Main"];
                    var ens = data["Ens"];
                   

                    //绑定字段.
                    GenerBindDDL("DDL_GroupField", ens, "KeyOfEn", "Name");
                    GenerBindDDL("DDL_SubThreadWorker", ens, "KeyOfEn", "Name");
                    GenerBindDDL("DDL_SubThreadGroupMark", ens, "KeyOfEn", "Name");

                    //执行批量主表赋值.
                    GenerFullAllCtrlsVal(main);
                    return;

                }
            });
            $("#Msg").html("");

        });

    </script>
</head>
<body>
<form id="cc" action="" >
 <table class='Table' cellpadding='2' cellspacing='2'>
<tr>
<TH >ID</TH>
<TH class='Title' colspan="3" >明细表属性 </TH>
</tr>
<tr bgcolor="white" >
<td class="Idx" >1</td>
<td   >表英文名称</td>
<td   colspan="2"  ><input name="TB_No" type="text" value="" size="40" id="TB_No" disabled="disabled" class="aspNetDisabled" /></td>
</tr>
<tr bgcolor="AliceBlue" >
<td class="Idx" >2</td>
<td   >表中文名称</td>
<td   colspan="2"  ><input name="TB_Name" type="text" value="" size="40" id="TB_Name" /></td>
</tr>
<tr bgcolor="white" >
<td class="Idx" >3</td>
<td   >物理表名</td>
<td   colspan="2"  ><input name="TB_PTable" type="text" value="" size="40" id="TB_PTable" /></td>
</tr>
<tr bgcolor="AliceBlue" >
<td class="Idx" >4</td>
<td   >工作模式</td>
<td ><select name="DDL_Model" id="DDL_Model">
	<option  value="0">普通</option>
	<option value="1">固定行</option>
</select></td>
<td >&nbsp;</td>
</tr>
<tr bgcolor="white" >
<td class="Idx" >5</td>
<td ><input id="CB_IsView" type="checkbox" name="CB_IsView"   /><label for="CB_IsView">是否可见</label></td>
<td ><input id="CB_IsUpdate" type="checkbox" name="CB_IsUpdate"  /><label for="CB_IsUpdate">是否可以修改行</label></td>
<td ><input id="CB_IsInsert" type="checkbox" name="CB_IsInsert"   /><label for="CB_IsInsert">是否可以新增行</label></td>
</tr>

<tr bgcolor="AliceBlue" >
<td class="Idx" >6</td>
<td ><input id="CB_IsDelete" type="checkbox" name="CB_IsDelete" /><label for="CB_IsDelete">是否可以删除行</label></td>
<td ><input id="CB_IsShowIdx" type="checkbox" name="CB_IsShowIdx"  /><label for="CB_IsShowIdx">是否显示序号列</label></td>
<td ><input id="CB_IsShowSum" type="checkbox" name="CB_IsShowSum" /><label for="CB_IsShowSum">是否合计行</label></td>
</tr>

<tr bgcolor="white" >
<td class="Idx"  >7</td>
<td ><input id="CB_IsEnableAthM" type="checkbox" name="CB_IsEnableAthM" /><label for="CB_IsEnableAthM">是否启用多附件</label></td>
<td ><input id="CB_IsEnableM2M" type="checkbox" name="CB_IsEnableM2M" /><label for="CB_IsEnableM2M">是否启用一对多</label></td>
<td ><input id="CB_IsEnableM2MM" type="checkbox" name="CB_IsEnableM2MM" /><label for="CB_IsEnableM2MM">是否启用一对多多</label></td>
</tr>
<tr bgcolor="AliceBlue" >
<td class="Idx" >8</td>
<td   colspan="3"  ><input id="CB_IsRowLock" type="checkbox" name="CB_IsRowLock" /><label for="CB_IsRowLock">是否启用锁定行（如果启用就需要增加IsRowLock一个隐藏的列，默认值为0。）？</label></td>
</tr>
<tr bgcolor="white" >
<td class="Idx" >9</td>
<td   colspan="3"  ><input id="CB_IsShowTitle" type="checkbox" name="CB_IsShowTitle" checked="checked" /><label for="CB_IsShowTitle">是否显示标头(如果是多表表头的明细表，就不要显示表头了)?</label></td>
</tr>
<tr bgcolor="AliceBlue" >
<td class="Idx" >10</td>
<td   >增加记录方式</td>
<td ><select name="DDL_DtlAddRecModel" id="DDL_DtlAddRecModel">
	<option selected="selected" value="0">按设置的数量初始化空白行</option>
	<option value="1">用按钮增加空白行</option>
</select></td>
<td   >满足不同的用户习惯</td>
</tr>
<tr bgcolor="white" >
<td class="Idx" >11</td>
<td   >初始化行数</td>
<td ><input name="TB_RowsOfList" type="text" id="TB_RowsOfList" class="TBNum" /></td>
<td   >&nbsp;</td>
</tr>
<tr bgcolor="AliceBlue" >
<td class="Idx" >12</td>
<td   >高度</td>
<td ><input name="TB_H" type="text"  id="TB_H" class="TBNum" /></td>
<td   >对傻瓜表单有效,宽度有tabele控制.</td>
</tr>
<tr bgcolor="white" >
<td class="Idx" >13</td>
<td   >显示格式</td>
<td ><select name="DDL_EditModel" id="DDL_EditModel">
	<option value="0">表格</option>
	<option value="1">卡片(自由模式)</option>
	<option value="2">卡片(傻瓜模式)</option>
</select></td>
<td >&nbsp;</td>
</tr>
<tr bgcolor="AliceBlue" >
<td class="Idx" >14</td>
<td   >越出处理</td>
<td ><select name="DDL_WhenOverSize" id="DDL_WhenOverSize">
	<option value="0">不处理</option>
	<option value="1">向下顺增行</option>
	<option value="2">次页显示</option>
</select></td>
<td >&nbsp;</td>
</tr>
<tr bgcolor="white" >
<td class="Idx" >15</td>
<td   >存盘方式</td>
<td ><select name="DDL_DtlSaveModel" id="DDL_DtlSaveModel">
	<option value="0">自动存盘(失去焦点自动存盘)</option>
	<option value="1">手动存盘(保存按钮触发存盘)</option>

</select></td>
<td   >用于设置在明细表自动存盘还是，手动存盘.</td>
</tr>
<tr class='TRSum' >
<TH class='Title' colspan="4" >与工作流相关设置</TH>
</tr>
<tr class="TR1" >
<td class="Idx" >16</td>
<td   >操作权限</td>
<td ><select name="DDL_DtlOpenType" id="DDL_DtlOpenType">
	<option value="0">操作员</option>
	<option value="1">工作ID</option>
	<option value="2">流程ID</option>

</select></td>
<td >&nbsp;</td>
</tr>
<tr>
<td class="Idx" >17</td>
<td ><input id="CB_IsEnablePass" type="checkbox" name="CB_IsEnablePass" /><label for="CB_IsEnablePass">是否起用审核字段？</label></td>
<td colspan="2"  ><input id="CB_IsEnableGroupField" type="checkbox" name="CB_IsEnableGroupField" /><label for="CB_IsEnableGroupField">是否起用分组字段？</label><select name="DDL_GroupField" id="DDL_GroupField">
	<!--<option  value="FID">FID</option>
	<option value="OID">主键</option>
	<option value="RDT">记录时间</option>
	<option value="Rec">记录人</option>s
	<option value="RefPK">关联ID</option>
	<option value="ShiMeShiJianDaoDa">什么时间到达</option>
	<option value="WanChengRiQi">完成日期</option>
	<option value="WoDeBiaoTi">我的标题</option>
	<option value="WoDeLie">我的列</option>
	<option value="WoDeShuJuLeiXing">我的数据类型</option>
	<option value="WoDeShuZhi">我的数值</option>-->
</select>
</td>
</tr>
<tr class="TR1" >
<td class="Idx" >18</td>
<td   colspan="3"  ><input id="CB_IsCopyNDData" type="checkbox" name="CB_IsCopyNDData" /><label for="CB_IsCopyNDData">是允许从上一个节点Copy数据</label></td>
</tr>
<tr>
<td class="Idx" >19</td>
<td   colspan="3"  ><input id="CB_IsHLDtl" type="checkbox" name="CB_IsHLDtl" /><label for="CB_IsHLDtl">是否是合流汇总从表(当前节点是合流节点有效)</label></td>
</tr>
<tr>
<td class="Idx" >20</td>
<td   colspan="3"  ><input id="CB_IsFLDtl" type="checkbox" name="CB_IsFLDtl" /><label for="CB_IsFLDtl">是否是分流点从表(当前节点是分流节点有效)</label></td>
</tr>
<tr>
<td class="Idx" >21</td>
<td   >子线程处理人字段</td>
<td   colspan="2"  ><select name="DDL_SubThreadWorker" id="DDL_SubThreadWorker">
	<!--<option value="ShiMeShiJianDaoDa">什么时间到达</option>
	<option value="WoDeLie">我的列</option>
	<option value="WoDeShuJuLeiXing">我的数据类型</option>-->
</select></td>
</tr>

<tr>
<td class="Idx" >22</td>
<td   >子线程批次号字段</td>
<td   colspan="2"  ><select name="DDL_SubThreadGroupMark" id="DDL_SubThreadGroupMark">
	<!--<option selected="selected" value="ShiMeShiJianDaoDa">什么时间到达</option>
	<option value="WoDeLie">我的列</option>
	<option value="WoDeShuJuLeiXing">我的数据类型</option>-->

</select></td>
</td>
</tr>
<tr class='TRSum' >
<TH class='Title' colspan="4" >数据导入导出</TH>
</tr>
<tr>
<td class="Idx" >23</td>
<td ><input id="CB_IsExp" type="checkbox" name="CB_IsExp"  /><label for="CB_IsExp">是否可以导出？</label></td>
<td ><input id="CB_IsImp" type="checkbox" name="CB_IsImp"  /><label for="CB_IsImp">是否可以导入？</label></td>
<td >&nbsp;</td>
</tr>
<tr>
<td class="Idx" >24</td>
<td   colspan="3"  ><input id="CB_IsEnableSelectImp" type="checkbox" name="CB_IsEnableSelectImp" /><label for="CB_IsEnableSelectImp">是否启用选择性导入(如果true就要配置数据源呈现的sql)？</label></td>
</tr>
<tr>
<td class="Idx" >25</td>
<td   >初始化SQL</td>
<td   colspan="2"  ><input name="TB_ImpSQLInit" type="text" size="80" id="TB_ImpSQLInit" /></td>
</tr>
<tr>
<td class="Idx" >26</td>
<td   >查询SQL</td>
<td   colspan="2"  ><input name="TB_ImpSQLSearch" type="text" size="80" id="TB_ImpSQLSearch" /></td>
</tr>
<tr>
<td class="Idx" >27</td>
<td   >填充SQL</td>
<td   colspan="2"  ><input name="TB_ImpSQLFull" type="text" size="80" id="TB_ImpSQLFull" /></td>
</tr>
<tr class='TRSum' >
<TH class='Title' colspan="4" ="true" >表格右边列超连接配置</TH>
</tr>
<tr>
<td class="Idx" >28</td>
<td ><input id="CB_IsEnableLink" type="checkbox" name="CB_IsEnableLink" /><label for="CB_IsEnableLink">是否启用超连接？</label></td>
<td   >超连接标签</td>
<td ><input name="TB_LinkLabel" type="text" value="详细" id="TB_LinkLabel" /></td>
</tr>
<tr>
<td class="Idx" >29</td>
<td colspan="3" >连接URL</td>
</tr>
<tr>
<td class="Idx" >30</td>
<td   colspan="3"  ><input name="TB_LinkUrl" type="text" value="" size="90" id="TB_LinkUrl" /></td>
</tr>
<tr>
<td class="Idx" >31</td>
<td   >连接目标</td>
<td   colspan="2"  ><input name="TB_LinkTarget" type="text" value="_blank" id="TB_LinkTarget" /></td>
</tr>
<tr class='TRSum' >
<td   >&nbsp;</td>
<td colspan="3" align="center" ="true" >
<input type="button" name="Btn_Save" value="保存" onclick="Save();" id="Btn_Save"/>
<input type="button" name="Btn_SaveAndClose" onclick="SaveAndClose();" value=" 保存并关闭 " id="Btn_SaveAndClose"  />
<input type="button" name="Btn_Close" onclick="Close();" value=" 关闭 " id="Btn_Close"  />

<!--<input type="submit" name="Btn_Del" value="删除" onclick="Del(this);"  onclick=" return confirm('您确认吗？');" id="Btn_Del" />-->
</td>
</tr>
</table>

<script type="text/javascript">

    //执行保存
    function Save() {

        $("#Msg").html("正在执行保存.....");
        var frmData = $("#cc").serialize();

        //保存的时候，需要把 CheckBoxIDs 传递过去，这个参数名是约定的,用于解决批量保存实体没有传入checkbox的值的问题.
        var url = Handler + "?DoType=DtlSave&CheckBoxIDs=" + GenerCheckIDs() + "&FK_MapDtl=" + GetQueryString("FK_MapDtl") + "&FK_MapData=" + GetQueryString("FK_MapData") + "&m=" + Math.random();
      //  alert(url);
        $.ajax({
            data: frmData,
            type: 'post',
            async: true,
            url: url,
            dataType: 'html',
            success: function (data) {
                $("#Msg").html(data);
            }
        });

        $("#Msg").html("保存失败.");
    }

    function SaveAndClose() {
        Save();
        window.close();
    }

    function Close() {
        window.close();
    }

     
</script>
 
<div id="Msg"></div>

</form>
</body>
</html>
